package com.hailong.zyt.mapper;

import com.hailong.zyt.beans.GroupAll;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hailong
 * @since 2021-05-17
 */
public interface GroupAllMapper extends BaseMapper<GroupAll> {
    /*
     * 根据ID查询该学生加入了几个小组
     * */
    @Select("SELECT COUNT(gro_id) FROM group_all WHERE stu_id = #{stuId} GROUP BY stu_id")
    Integer selectGroupCount(@Param("stuId") Long stuId);
}
